#pragma once
#include "Comm.hpp"
#include <iostream>
class Client
{
public:
    Client() : _fd(gdefault)
    {
    }
    bool OpenPipeForWrite()
    {
       _fd = OpenPipe(gForWrite);
       if(_fd < 0)return false;
       return true;
    }
    int SendPipe(const std::string &in)
    {
        return write(_fd, in.c_str(), in.size()); // 往管道里写
    }
    void ClosePipe()
    {
        ClosePipeHelper(_fd);
    }

private:
    int _fd;
};